package domfarr.web.tapestry.pages;

import java.util.List;

import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Service;
import org.apache.tapestry5.ioc.annotations.Inject;

import domfarr.entities.Contact;
import domfarr.web.tapestry.services.ContactService;


public class ContactAdded {
	@Persist
	private String fullName;
	
	@Inject
	@Service("contactService")
	private ContactService contactService;

	public String getMessage() {
		return "Contact " + fullName + " Added Successfully";
	}
	
	public void setName(String fullName) {
		this.fullName = fullName;
	}
	
	public List<Contact> getList() {
		return contactService.findAll();
	}
}
